package at.fhj.itm11.forum.beans.stubs;

import java.util.Date;
import java.util.List;

import org.primefaces.model.UploadedFile;

import at.fhj.itm11.forum.service.PostService;
import at.fhj.itm11.forum.service.dtos.PostDTO;
import at.fhj.itm11.forum.service.dtos.TopicDTO;
import at.fhj.itm11.forum.service.dtos.UserDTO;

public class PostServiceStub implements PostService {

	@Override
	public List<PostDTO> getPostsByTopicId(long topicId) {
		return null;
	}

	@Override
	public long addPost(String title, String text, UploadedFile image,
			UploadedFile video, TopicDTO topic, UserDTO user)
			throws IllegalArgumentException {
		return 0;
	}

	@Override
	public PostDTO findById(long id) {
		PostDTO dto = new PostDTO();
		dto.setId(id);
		dto.setDate(new Date());

		if (id == 1L) {
			dto.setImage(new byte[] { 1, 2, 3, 4 });
		}

		if (id == 2L) {
			dto.setVideo(new byte[] { 1, 2, 3, 4 });
		}

		return dto;
	}

}
